function getParamByKey(key){
    var params = location.search;
    params = params.substring(1);//取掉开头的？
    var paramArr = params.split("&");
    if(paramArr!=null && paramArr.length > 0){
        for(var i = 0;i<paramArr.length;i++){
            var itm = paramArr[i];//id=1
            var itmArr = itm.split("=");
            if(itmArr.length == 2 && itmArr[0] == key){//id
                return itmArr[1];//1
            }
        }
    }
    return null;
}